feat: Quickstart and client for Plain JS Script Tags#4161
feat: Quickstart and client for Plain JS Script Tags#4161clockwork-tien merged 6 commits intomasterfrom
Conversation
63a4d9c to
c07dfef
Compare
Remove the custom Client class that used JSON protocol and HTTP for reducer calls. Instead, use the standard DbConnection with code generation, which uses BSATN binary protocol over WebSocket. The browser-ts template now: - Uses spacetime generate for TypeScript bindings - Bundles bindings with vite into an IIFE - Loads the bundle in index.html with inline JavaScript
…into tien/feat/js-script-tags
|
@cloutiertyler Thank you, I have applied the changes from #4167, merged/resolved conflicts and did a minor template description update. The PR is ready for review. |
The IIFE and ESM browser bundles built from src/browser/index.ts are not used by the browser-ts template (which bundles its own bindings via Vite). The existing dist/index.browser.mjs already covers the browser ESM use case for import maps.
|
Removed the SDK-level browser bundle ( Long-term, the plan is to have the code generator emit |
…into tien/feat/js-script-tags
Description of Changes
The PR implements the following updates:
The bundle is served via
https://unpkg.com/spacetimedb@latest/dist/browser.bundle.js, which only works after the package is published to npm, therefore to test locally we can use thebrowser-tstemplate and local bundle:index.html(swap the URL fromunpkg)browser-ts/index.htmldirectly in browser along withspacetime start+ publish the modulespacetime publish --project-path spacetimedb browser-tsScreenshots
API and ABI breaking changes
Expected complexity level and risk
Testing